package com.example.administrator.myapplication.adapter;

import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.example.administrator.myapplication.MainActivity;

import java.util.ArrayList;

/**
 * Created by Administrator on 2020/12/15.
 */

public class MyAdapter extends FragmentPagerAdapter {

    Context context;
    ArrayList fragmentList;

    public MyAdapter(FragmentManager fm, Context context, ArrayList fragmentList) {
        super(fm);
        this.context = context;
        this.fragmentList = fragmentList;
    }

    public MyAdapter(FragmentManager fm) {
        super(fm);
    }



    @Override
    public Fragment getItem(int position) {
        return (Fragment) fragmentList.get(position);
    }

    @Override
    public int getCount() {
        return fragmentList.size();
    }
}